#!/bin/bash
. ./var
changehostname(){
    CHANGENAME=$(whiptail --title "更改主机名" --inputbox "请输入新的主机名，用-来连接" 10 60 `hostname` 3>&1 1>&2 2>&3)
    exitstatus=$?
    if [ $exitstatus = 0 ]; then
        whiptail --title "Message" --msgbox "主机名由\n$(hostname)\n改为:\n$CHANGENAME\n" 10 60
#         whiptail --title "Yes/No Box" --yesno "Choose between Yes and No." --msgbox "主机名将由\n$(hostname)\n改为:\n\"$CHANGENAME" 10 60
        hostnamectl set-hostname $CHANGENAME
        echoYellow "The updated hostname:  $(hostname)"
    else
        #echo "You chose Cancel."
        Entry_Menu_Bar
    fi
}
